package com.lrkj.back.service.impl;

import java.util.List;
import java.util.Map;

import com.lrkj.back.entity.ZsQingxi;
import com.lrkj.back.service.ZsQingxiService;
import com.lrkj.back.mapper.ZsQingxiMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.com.cbons.mamisay.parent.db.api.DBInterface;
import cn.com.cbons.mamisay.parent.exception.DBException;
import cn.com.cbons.mamisay.parent.service.base.ParentServiceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Transactional
@Service
public class ZsQingxiServiceImpl extends ParentServiceImpl<ZsQingxi> implements ZsQingxiService {

    @Autowired
    private ZsQingxiMapper zsqingxi;

    @Override
    protected DBInterface<ZsQingxi> getDao() throws DBException {
        // TODO Auto-generated method stub
        return zsqingxi;
    }

    @Override
    public PageInfo<ZsQingxi> findAllZsQingxi(Map<String, Object> map) throws DBException {
        PageHelper.startPage(Integer.valueOf(map.get("pageNo").toString()),
                Integer.valueOf(map.get("pageSize").toString()));
        List<ZsQingxi> tbList = zsqingxi.findAllZsQingxi(map);
        PageInfo<ZsQingxi> page = new PageInfo<>(tbList);
        return page;

    }

    @Override
    public List<ZsQingxi> findAllZsQingxiNoPage(Map<String, Object> map) throws DBException {
        return zsqingxi.findAllZsQingxi(map);

    }

    @Override
    public int updataBatch(List<ZsQingxi> list) {
        return zsqingxi.updateBatch(list);
    }

    @Override
    public ZsQingxi findOne(Map<String, Object> map) throws DBException {
        return zsqingxi.findOne(map);
    }

    @Override
    public int insertBatch(List<ZsQingxi> list) throws DBException {
        return zsqingxi.insertBatch(list);
    }

}
